﻿<Window x:Class="Profit.Views.AboutView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Profit.Controls" 
        mc:Ignorable="d"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:Resources="clr-namespace:Profit.Resources"
        d:DesignHeight="330" d:DesignWidth="550" 
        SizeToContent="WidthAndHeight"
        ShowInTaskbar="False"
        ResizeMode="NoResize"
        MaxWidth="500"
        MaxHeight="330"
        Icon="/Profit;component/Resources/Icons/app_32.ico">
    <Window.Resources>
        <Style x:Key="rightAlignedLabel" TargetType="{x:Type Label}">
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>
        <Style x:Key="leftAlignedLabel" TargetType="{x:Type Label}">
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <Grid Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Grid.Column="0" Content="{x:Static Resources:Messages.label_description}" Style="{StaticResource rightAlignedLabel}"/>
            <Label Grid.Row="0" Grid.Column="1" Content="{Binding Path=ApplicationDescription}" Style="{StaticResource leftAlignedLabel}"/>
            <Label Grid.Row="1" Grid.Column="0" Content="{x:Static Resources:Messages.label_version}" Style="{StaticResource rightAlignedLabel}"/>
            <Label Grid.Row="1" Grid.Column="1" Content="{Binding Path=ApplicationVersion}" Style="{StaticResource leftAlignedLabel}"/>
            <Label Grid.Row="2" Grid.Column="0" Content="{x:Static Resources:Messages.label_copyrights}" Style="{StaticResource rightAlignedLabel}"/>
            <Label Grid.Row="2" Grid.Column="1" Content="{Binding Path=ApplicationCopyrights}" Style="{StaticResource leftAlignedLabel}"/>
            <ScrollViewer Grid.Row="3" Grid.ColumnSpan="2"  VerticalScrollBarVisibility="Auto" Margin="0,10,0,0">
                <TextBlock Text="{Binding Path=ApplicationGeneralNotice}" TextWrapping="Wrap" Margin="5,0,2,0"/>
            </ScrollViewer>

            <Image 
                Grid.Row="0" 
                Grid.Column="0" 
                Grid.ColumnSpan="3" 
                Grid.RowSpan="3" 
                Opacity="1"
                Height="100"
                Margin="0,2,2,0"
                HorizontalAlignment="Right" 
                VerticalAlignment="Stretch" 
                Source="/Profit;component/Resources/Icons/logo.png" />
        </Grid>
        <StackPanel 
            Orientation="Horizontal"
            Grid.Column="0"
            Grid.Row="2"
            HorizontalAlignment="Left" >
            
            <ProgressBar 
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Width="100"
                Height="16"
                Margin="11,0,5,0"
                Visibility="{Binding UpdateChecker.IsSearching, Converter={StaticResource BooleanToVisibilityConverter}}"
                IsIndeterminate="{Binding UpdateChecker.IsSearching}" />
            
            <Label
                Visibility="{Binding UpdateChecker.IsSearching, Converter={StaticResource BooleanToVisibilityConverter}}"
                HorizontalAlignment="Left"
                VerticalAlignment="Center"
                Content="{x:Static Resources:Messages.label_checking_new_version}" />
        </StackPanel>
        
        <local:DialogActionsPanel
            Grid.Column="1"
            Grid.Row="2" 
            HorizontalAlignment="Right"
            VerticalAlignment="Bottom"
            ShowButtonCancel="False"
            ButtonOkCommand="{Binding ValidateCommand}" />
    </Grid>
</Window>
